﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using attendance.L2Busslogic;
using System.IO;

namespace attendance.L4View.master
{
    public partial class master_reset : System.Web.UI.Page
    {
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (qiandaoBL.deleteAll())
            {
//                DeleteFolder("C:\\Users\\俊\\Desktop\\attendance\\attendance\\L4View\\student\\image");
                Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='javascript' defer>alert('重置成功 ');</script>");
                return;
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='javascript' defer>alert('重置不成功 ');</script>");
                return;
            }
        }
/*        public void DeleteFolder(string dir)
        {
            if (Directory.Exists(dir)) //如果存在这个文件夹删除之   
            {
                foreach (string d in Directory.GetFileSystemEntries(dir))
                {
                    if (File.Exists(d))
                        File.Delete(d); //直接删除其中的文件                          
                    else
                        DeleteFolder(d); //递归删除子文件夹   
                }
                Directory.Delete(dir, true); //删除已空文件夹                   
            }
        } */
    }
}